import React from "react";
import { allRegisterInfo } from "../../regist-components";
import { useEditorContext } from "../../store/editor-provider";

type Props = {};

export default function ComponentSettingsPannel(props: Props) {
  const { curWidgetInfo } = useEditorContext();

  const StyleConfig =
    allRegisterInfo[curWidgetInfo!.name].components?.StyleConfig;

  return (
    <div>
      {StyleConfig
        ? React.createElement(StyleConfig, {
            info: curWidgetInfo
          })
        : "组件暂未注册StyleConfig"}
    </div>
  );
}
